
/**
 * libappleiigo
 * Event Controller
 * (C) 2008 by Marc S. Ressl (mressl@umich.edu)
 * Released under the GPL
 */

#ifndef APPLEIIEVENTCONTROLLER_H
#define APPLEIIEVENTCONTROLLER_H

#include "Component.h"

enum
{
	EVENT_CPUCLOCKASSERTED,
	EVENT_SCANLINEENDED,
	EVENT_FRAMESTARTED,
	EVENT_FRAMEIRQASSERTED,
	EVENT_FRAMEENDED,
	EVENT_COMPUTERRESTARTED,
	EVENT_RESETASSERTED,
	EVENT_RESETCLEARED,
	EVENT_IRQASSERTED,
	EVENT_IRQCLEARED,
	EVENT_NMIASSERTED,
	EVENT_TIMERELAPSED,
};

enum
{
	MSG_RENDERFRAME,
	MSG_RESTART,
	MSG_ASSERTRESET,
	MSG_CLEARRESET,
	MSG_ASSERTIRQ,
	MSG_CLEARIRQ,
	MSG_ASSERTNMI,
	MSG_SETPALTIMING,
	MSG_ISPALTIMING,
	MSG_SETCPUCLOCKFACTOR,
	MSG_GETCPUCLOCKFACTOR,
	MSG_GETVERTICALCOUNT,
	MSG_GETHORIZONTALCOUNT,
	MSG_GETQ3CLOCK,
	MSG_GETTIMER,
	MSG_SETTIMER,
};

struct EventMessage
{
	uint32_t command;
	uint32_t parameter;
};

class EventController : public Component
	{
	public:
		virtual void sendMessage(void * message);
	};

#endif
